import axios from "../../WuJiUtils/http";

/* 
    登录接口
    /login  
    post
    username,password,type
    {code:200,msg:'登录成功'} 500 账号或密码错误
*/
const loginApi = async (_data: { username: string, password: string }) => {
    const data = await axios({
        url: '/admin/login',
        method: 'post',
        data: _data
    })
    return data
}
//渲染
const renderApi = async (_data: { page: number, count: number }) => {
    const data: { [propsName: string]: any } = await axios({
        url: '/vipUser/list',
        method: 'post',
        data: _data
    })
    return data
}


//修改
const editApi = async (_data: { user: string, password: string, surepassword: string }) => {
    const data = await axios({
        url: 'http://172.16.129.235:8081/admin/admin/login',
        method: 'post',
        data: _data
    })
    return data
}
//删除
const delApi = async (_data: { username: string, password: string }) => {
    const data = await axios({
        url: 'http://172.16.129.235:8081/admin/admin/login',
        method: 'post',
        data: _data
    })
    return data
}
export {
    renderApi,
    loginApi,
    editApi,
    delApi
}